# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>

_gitcommit="6d99ee01ecb3d2930d5440b0e78e2cb3b1f3f326"

pkgname=libstirshaken
pkgver=0_git20240208
pkgrel=2
pkgdesc="C library implementing STIR-shaken STI-SP AS/VS, STI-CA"
url="https://github.com/signalwire/libstirshaken"
arch="all"
license="MIT"
subpackages="$pkgname-dev $pkgname-tools"
makedepends="autoconf automake bash curl-dev libjwt-dev libks-dev libtool util-linux-dev"
options="!check" # FAIL: Failed to write cert to disk. test/stir_shaken_test_8.c:116
source="$pkgname-$pkgver.tar.gz::https://github.com/signalwire/libstirshaken/archive/$_gitcommit.tar.gz
	0001-eradicate-Werror.patch
	"
builddir="$srcdir/$pkgname-$_gitcommit"

build() {
	autoreconf -i
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

package() {
	make DESTDIR="$pkgdir" install

}

check() {
	make check
}

tools() {
	pkgdesc="libstirshaken binary tools"
	amove usr/bin
}

sha512sums="
93ca507f11e28be4c5fdee41e3a3de6d755bb1c0db7ff55b28cc4e35f4ce583f39ec6e43f090e5d3506afc72f94ecd049d2b726bfd31085d683a0436bf9d1e15  libstirshaken-0_git20240208.tar.gz
4f3a10416970d33c15736c1b3e751a91e603841d30e7fee18e77dbc46a15740967117230d6e032c7df3c5b3e05203141bb58ba52fd7e0ce918c85661f55d33c3  0001-eradicate-Werror.patch
"
